/******************************************************************************
 * The contents of this file are subject to the   JDI License  Version 1.0
 * ("License"); You may not use this file except in compliance with the License
 * Software distributed under the License is distributed on an  "AS IS"  basis,
 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
 * the specific language governing rights and limitations under the License.
 * The Initial Developer of the Original Code is 陈慧然. Portions created by 
 * 陈慧然 are Copyright 陈慧然.
 * All Rights Reserved.
 *
 *              Contact john_holen@163.com for licensing alternatives.
 *
 *****************************************************************************/


package org.peony.client.web.components.table;

import org.peony.client.web.components.WebComponents;
import org.peony.exceptions.RenderException;
import org.peony.standard.ui.SIComponent;
import org.peony.tools.StringUtil;

/**
 *  
 *
 *  @author     陈慧然
 *  @version    Id: Td.java, v 0.000 2008-3-18 上午10:04:02 陈慧然 Exp
 */
public class Td extends WebComponents{
	
	private SIComponent value = null;

	public String toStandardString() throws RenderException {
		if(StringUtil.isEmpty(getId()))
			throw new RenderException("Td(A Component) Can NOT has no id!");
		StringBuffer sb = new StringBuffer();
		sb.append("<td ").append("id= \"").append(getId()).append("\"")
			.append(StringUtil.isNotEmpty(getUIClass())?" class=\"" + getUIClass() + "\">" : ">")
			.append(value==null?empty:value.toStandardString()).append("</td>");
		return sb.toString();
	}

	public SIComponent getValue() {
		return value;
	}

	public void setValue(SIComponent value) {
		this.value = value;
	}

	
	
	
}
